﻿/**
* Masque JS Library 0.0.1.4
* Copyright(c) 2008, 青岛领创网络科技有限公司
* @author Lookingon Team
*/
/**
* Hides all drop down form select boxes on the screen so they do not appear above the mask layer.
* IE has a problem with wanted select form tags to always be the topmost z-index or layer
*
* Thanks for the code Scott!
*/
function hideSelectBoxes() {
    for (var i = 0; i < document.forms.length; i++) {
        for (var e = 0; e < document.forms[i].length; e++) {
            if (document.forms[i].elements[e].tagName == "SELECT") {
                document.forms[i].elements[e].style.visibility = "hidden";
            }
        }
    }
}

/**
* Makes all drop down form select boxes on the screen visible so they do not reappear after the dialog is closed.
* IE has a problem with wanted select form tags to always be the topmost z-index or layer
*/
function displaySelectBoxes() {
    for (var i = 0; i < document.forms.length; i++) {
        for (var e = 0; e < document.forms[i].length; e++) {
            if (document.forms[i].elements[e].tagName == "SELECT") {
                document.forms[i].elements[e].style.visibility = "visible";
            }
        }
    }
}

if (Masque && !Masque.Dis) {
    Masque.Dis = {
        InnerZoom: function(maxWidth, maxHeight, ele) {
            var pWidth = ele.offsetWidth;
            var pHeight = ele.offsetHeight;
            var ratW = maxWidth / pWidth;
            var ratH = maxHeight / pHeight;
            var rat = ratW < ratH ? ratW : ratH;
            return { Width: pWidth * rat, Height: pHeight * rat };
        }
    }
}

Masque.Dis.AutoHidden = function(c, dTime, step, Speed) {
    this.__Timer = 0;
    this.__Step = step;
    this.__Speed = Speed;
    if (this.__Speed < 1)
        this.__Speed = 1;
    this.__Transparent = 100;
    var me = this;
    this.__dTime = dTime - step;
    this.__E = c;

    if (typeof Masque.Dis.AutoHidden._initialized == "undefined") {
        Masque.Dis.AutoHidden.prototype.__Hidden = function() {
            var me = this;
            me.__Transparent -= step;
            if (me.__Transparent < 1) {
                me.__E.style.display = "none";
                if (me.__Timer > 0) {
                    window.clearInterval(me.__Timer);
                }
            }
            else {
                if (Masque.isIE) {
                    me.__E.style.filter = 'Alpha(Opacity=' + me.__Transparent.toString() + ")";
                    //me.__E.filters.Alpha.play();
                }
                else {
                    var v = (me.__Transparent / 100)
                    me.__E.runtimeStyle.MozOpacity = v;
                    me.__E.runtimeStyle.opacity = v;

                }
            }
        };

        Masque.Dis.AutoHidden.prototype.Reset = function() {
            var me = this;
            me.__Transparent = 100;
            if (me.__Timer > 0) {
                Try.these(function() {
                    window.clearIntervar(me.__Timer);
                }, function() {
                    window.clearTimeout(me.__Timer);
                })
            }

            if (Masque.isIE) {
                me.__E.style.filter = 'Alpha(Opacity=100)';
            }
            else {
                me.__E.style.MozOpacity = 1;
                me.__E.style.opacity = 1;
            }

            if (me.__dTime > 0) {
                me.__Timer = window.setTimeout(function() {
                    window.clearTimeout(me.__Timer);
                    me.__Timer = setInterval(function() {
                        me.__Hidden();
                    }, me.__Speed);
                }, me.__dTime)
            }
            else {
                me.__Timer = setInterval(function() {
                    me.__Hidden();
                }, me.__Speed);
            }

        }

        Masque.Dis.AutoHidden._initialized = true;
    }

    this.Reset();
}
        
        
        


